@extends('default.layouts.adminPublic')
@section('title', '简历投诉管理')
@section('headcss')
    @parent

    @endsection
@section('content')
        <!--导航开始-->
<div class="crumb_warp">
    <i class="fa fa-home"></i> <a href="{{url('admin/resume_complain')}}">首页</a> &raquo; 简历投诉管理
</div>
<!--导航结束-->
<!--结果集标题与导航组件 开始-->
<link rel="stylesheet" href="{{asset('/default/css/admin/indexList.css')}}">
<div class="con">
    <div class="conMain">
        <div class="result_wrap">
            <div class="search">
                <form name="Formso" id="Formso" action="{{url('admin/resume_complain')}}" method="post">
                    {{csrf_field()}}
                    <span>关键字：</span>
                    <span><input name="keyword" class="keyword" id="keyword" placeholder="请输入简历名称或者公司名称" type="text"></span>
                    <select name="type" id="type">
                        <option value="0">不限</option>
                        @foreach($collOption as $v)
                            <option value="{{$v->opt_id}}">{{$v->opt_name}}</option>
                        @endforeach
                    </select>
                    <span><input name="submit" class="skeyword" value="搜索" type="submit"></span>
                </form>
            </div>
        </div>
        <div class="manage">
            @include('flash::message')
        </div>
        <div class="conInfo">
            <form name="thisForm" id="thisForm" action="" method="post">
            {{csrf_field()}}
            <div class="conList" id="conList">
                <dl class="one">
                    <dt><input name="selectall" type="checkbox" value="1" onclick="CheckAll(this)" /></dt>
                    <dd class="cssp1">简历姓名</dd>
                    <dd class="cssp2">最高学历</dd>
                    <dd class="cssp3">手机号码</dd>
                    <dd class="cssp4">公司名称</dd>
                    <dd class="cssp5">投诉类型</dd>
                    <dd class="cssp6">操作</dd>
                </dl>
                @if($resumeComplain->count() > 0 )
                    @foreach($resumeComplain as $v)
                        <dl id="list{{$v->id}}">
                            <dt><input name="selected_id[]" type="checkbox" value="{{$v->id}}" /></dt>
                            <dd class="cssp1"><a href="{{url('resume_'.idEncryption($v->resume_id).'.html')}}" target="_blank">{{$v->name}}</a></dd>
                            <dd class="cssp2">{{$v->education_name}}</dd>
                            <dd class="cssp3">{{$v->mobile}}</dd>
                            <dd class="cssp4">{{$v->company_name}}</dd>
                            <dd class="cssp5">{{$v->type_name}}</dd>
                            <dd class="cssp6">
                                <span class="down_complain"><a>下沉简历</a></span>
                                <span class="del"><a>删除简历</a></span>
                                <span class="dismissed_complain"><a>驳回简历</a></span>
                                <span class="pass_complain"><a>跳过</a></span>
                            </dd>
                        </dl>
                    @endforeach
                @else
                    <div class="nullcon">对不起！没有符合条件的记录！</div>
                @endif
                <dl class="last">
                    <dt>
                        <input name="selectall" id="selectall" type="checkbox" value="1" onclick="CheckAll(this)" />
                        <label for="selectall">全选</label>
                    </dt>
                    <dd class="p6"><a onclick="showconfirm('{{url('admin/batch_down_complain')}}','1')">下沉简历</a></dd>
                    <dd class="p6"><a onclick="showconfirm('{{url('admin/batch_del_complain')}}','2')">删除简历</a></dd>
                    <dd class="p6"><a onclick="showconfirm('{{url('admin/batch_dismissed_complain')}}','3')">驳回简历</a></dd>
                    <dd class="p6"><a onclick="showconfirm('{{url('admin/pass_complain')}}','4')">跳过</a></dd>
                </dl>
            </div>
            </form>
            <div class="page_list" style="width: 100%; float: left; margin-top:15px;">
                {{$resumeComplain->links()}}
            </div>
        </div>

        <div class="stopper" style="margin-top:10px; border-top: 1px solid #e5e5e5"></div>
    </div>
</div>
<!--结果集标题与导航组件 结束-->
@endsection

@section('footerjs')
    @parent
    <script>
        $(function(){
            @if($resumeComplain->count() > 0 )
                @foreach($resumeComplain as $v)
                    //单条下沉简历
                    $('#conList').find("#list" + '{{$v->id}}').find('.down_complain a').click(function(){
                        layer.confirm('简历时间将更新到前5天的状态！您确定要下沉这份简历吗？', {
                            btn: ['确定', '取消'],btnAlign: 'c' ,area: '350px'
                        }, function () {
                            $.post("/admin/down_complain",{'id':'{{$v->id}}','resume_id':'{{$v->resume_id}}','_token':"{{csrf_token()}}"},function (data) {
                                if(data.status==0){
                                    layer.msg(data.msg, {icon: 6,time:1500});
                                    window.location.href = "{{url('/admin/resume_complain')}}";
                                }else{
                                    layer.msg(data.msg, {icon: 5,time:1500});
                                }
                            });
                        });
                    });

                    //单条删除简历
                    $('#conList').find("#list" + '{{$v->id}}').find('.del a').click(function(){
                        layer.confirm('您确定要删除这份简历吗？', {
                            btn: ['确定', '取消','对关联投诉做相同处理'],btnAlign: 'c' ,area: '450px',
                            yes:function(){
                                $.post("/admin/del_complain",{'id':'{{$v->id}}', 'resume_id':'{{$v->resume_id}}','type':1, '_token':"{{csrf_token()}}"},function (data) {
                                    if(data.status==0){
                                        layer.msg(data.msg, {icon: 6,time:1500});
                                        window.location.href = "{{url('/admin/resume_complain')}}";
                                    }else{
                                        layer.msg(data.msg, {icon: 5,time:1500});
                                    }
                                });
                            },btn3:function(){
                                $.post("/admin/del_complain",{'id':'{{$v->id}}', 'resume_id':'{{$v->resume_id}}','type':2, '_token':"{{csrf_token()}}"},function (data) {
                                    if(data.status==0){
                                        layer.msg(data.msg, {icon: 6,time:1500});
                                        window.location.href = "{{url('/admin/resume_complain')}}";
                                    }else{
                                        layer.msg(data.msg, {icon: 5,time:1500});
                                    }
                                });
                            }
                        });
                    });


                    //单条驳回简历
                    $('#conList').find("#list" + '{{$v->id}}').find('.dismissed_complain a').click(function(){
                        layer.confirm('您确定要驳回这份简历吗？', {
                            btn: ['确定', '取消','对关联投诉做相同处理'] ,btnAlign: 'c' ,area: '450px',
                             yes:function(){
                                $.post("/admin/dismissed_complain",{'id':'{{$v->id}}', 'resume_id':'{{$v->resume_id}}','type':1, '_token':"{{csrf_token()}}"},function (data) {
                                    if(data.status==0){
                                        layer.msg(data.msg, {icon: 6,time:1500});
                                        window.location.href = "{{url('/admin/resume_complain')}}";
                                    }else{
                                        layer.msg(data.msg, {icon: 5,time:1500});
                                    }
                                });
                            },btn3:function(){
                                $.post("/admin/dismissed_complain",{'id':'{{$v->id}}', 'resume_id':'{{$v->resume_id}}','type':2, '_token':"{{csrf_token()}}"},function (data) {
                                    if(data.status==0){
                                        layer.msg(data.msg, {icon: 6,time:1500});
                                        window.location.href = "{{url('/admin/resume_complain')}}";
                                    }else{
                                        layer.msg(data.msg, {icon: 5,time:1500});
                                    }
                                });
                            }

                       });
                    });

                    //跳过简历
                    $('#conList').find("#list" + '{{$v->id}}').find('.pass_complain a').click(function(){
                        layer.confirm('您真的要跳过这份投诉吗？', {
                            btn: ['确定', '取消'],btnAlign: 'c' ,area: '350px'
                        }, function () {
                            $.post("/admin/pass_complain",{'id':'{{$v->id}}','resume_id':'{{$v->resume_id}}','_token':"{{csrf_token()}}"},function (data) {
                                    layer.msg(data.msg, {icon: 6,time:1500});
                                    window.location.href = "{{url('/admin/resume_complain')}}";
                            });
                        });
                    });

                @endforeach
            @endif
        });
    </script>
    <script type="text/javascript" src="{{asset('/default/js/admin/resumeComplain.js')}}"></script>
@endsection